<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@taglib prefix="sf" uri="http://www.springframework.org/tags/form" %>
    
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>添加用户</title>
</head>
<body>
	 <div class="container">
            <div class="panel panel-primary">
                <div class="panel-heading">添加用户</div>
                <div class="panel-body">
                    <form action="<%=request.getContextPath()%>/admin/user/add"
                             method="post">
                            <div>
                            <label class="col-sm-2 control-label">
                               	 用户名
                            </label>
                            <div class="col-sm-10">
                                <input type="text" name="username" class="form-control" id="username" placeholder="请输入用户名"/>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">
                                昵称
                            </label>
                            <div class="col-sm-10">
                                 <input type="text" name="nickname" class="form-control" id="nickname" placeholder="请输入昵称"/>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">
                                密码
                            </label>
                            <div class="col-sm-10">
                                <input type="password" name="password" class="form-control" id="password" placeholder="请输入密码"/>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="inputstatus" class="col-sm-2 control-label">
                                状态
                            </label>
                            <div class="col-sm-10">
                                <select name="status" id="status" class="form-control">
                                    <option value="0">停用</option>
                                    <option value="1">启用</option>
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">
                                角色
                            </label>
                            <div class="col-sm-10">
                                <c:forEach var="role" items="${roles}">
                                    <div class="checkbox">
                                        <label>
                                            <input type="checkbox" name="roleId" value="${role.id}"/>${role.name}
                                        </label>
                                    </div>
                                </c:forEach>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-offset-2 col-sm-10">
                                <button type="submit" class="btn btn-default">提交</button>
                                <button type="reset" class="btn btn-default">重置</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>

</body>
</html>